<div class="builder">
    <div class="row">
        <notempty name="button_list">
            <div class="col-xs-12 col-sm-9 margin-bottom">
                <volist name="button_list" id="button">
                    <a style="margin-right:5px;" {$button.attr}>{$button.title}</a>
                </volist>
            </div>
        </notempty>
        <notempty name="search">
            <div class="col-xs-12 col-sm-3 margin-bottom">
                <div class="input-group search-form">
                    <input type="text" name="keyword" class="search-input form-control" value="{$_GET.keyword}" placeholder="{$search.title}">
                    <span class="input-group-btn"><a class="btn btn-default" href="javascript:;" id="search" url="{$search.url}"><i class="glyphicon glyphicon-search"></i></a></span>
                </div>
            </div>
        </notempty>
        <notempty name="tab_list">
            <div class="col-xs-12">
                <ul class="nav nav-tabs">
                    <volist name="tab_list" id="tab">
                        <li class="<php>if($current_tab == $key) echo 'active';</php>"><a href="{:U($tab_url, array('tab' => $key))}">{$tab}</a></li>
                    </volist>
                </ul>
                <div class="blank"></div>
            </div>
        </notempty>
        <!-- 数据列表 -->
        <div class="col-xs-12">
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th><input class="check-all" type="checkbox"></th>
                            <volist name="field_list" id="field">
                                <th>{$field.title|htmlspecialchars}</th>
                            </volist>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="data_list" id="data">
                            <tr>
                                <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
                                <volist name="field_list" id="field">
                                    <td>{$data[$field['name']]}</td>
                                </volist>
                            </tr>
                        </volist>
                    </tbody>
                </table>
                <ul class="pagination"><notempty name="page">{$page}</notempty></ul>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if(url.indexOf('?')>0){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });

        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
    </script>
    {$extra_html}<!-- 额外功能代码 -->
</div>
